package com.yunhe.java.others;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/7/24 0024.
 */
public class d {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int a = 1900;
        int b = 1;
        int c = 1;
        int d=1900;
        int e=7;
        int f =24;
        int day1=calcDate(a,b,c);
        int day2=calcDate(d,e,f);
        System.out.println(day1);
        System.out.println(day2);
        int sum=0;
        for(int i=a+1;i<d;i++){
            if((i%4==0)&&(i%100!=0)||i%400==0){
                sum+=366;
            }else {
                sum+=365;
            }
        } System.out.println(sum);
        if ((a % 4 == 0) && (a % 100 != 0) || a % 400 == 0){
            int day=366-day1;
        }else {
            int day=365-day1;
            System.out.println(day+sum+day2);
        }
    }
    public static int calcDate(int year, int month, int day) {
        int total = 0;
        for (int i = 1; i < month; i++) {
            int days;
            switch (i) {
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12: {
                    days = 31;
                }
                break;
                case 2: {
                    days = 28;
                    if ((year % 4 == 0) && (year % 100 != 0) || year % 400 == 0) {
                        days = 29;
                    }
                }break;
                case 4:
                case 6:
                case 9:
                case 11: {
                    days = 30;
                    break;
                }
                default:days = 30;
            }
            total += days;
        }
        return total + day;
    }
}


